package com.visionblue.business.ship.model.repository.db

import androidx.room.Dao
import androidx.room.Query
import androidx.room.Transaction

/**
 * @author: xlh
 * @date: 2020-06-05 10:25 AM
 * @desc:
 */
@Dao
interface RecordAndOrderDao {

    @Transaction
    @Query("select * from cached_order where sn=:sn order by end_time desc")
    suspend fun getAllCachedOrderWithCollectionRecords(sn: String?): List<RecordAndOrderRelation>

    @Transaction
    @Query("select * from cached_order where id=:id")
    suspend fun getCachedOrderWithCollectionRecordsByOrderId(id: Long): RecordAndOrderRelation

}